package com.gel.codegeneration.service;

import com.gel.codegeneration.model.dto.req.user.UserQueryRequest;
import com.gel.codegeneration.model.dto.resp.user.LoginUserVO;
import com.gel.codegeneration.model.dto.resp.user.UserVO;
import com.gel.codegeneration.model.entity.User;
import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.core.service.IService;
import jakarta.servlet.http.HttpServletRequest;

import java.util.List;


/**
 * 用户 服务层。
 *
 * @author <a>gel</a>
 */
public interface UserService extends IService<User> {
    /**
     * @description: 用户注册
     * @author: gel
     * @param: [userAccount, userPassword, checkPassword]
     * @return: long
     **/
    long register(String userAccount, String userPassword, String checkPassword);
    /**
     * @description:用户登录
     * @author: gel
     * @param: [userAccount, userPassword, request]
     * @return: com.gel.codegeneration.model.dto.resp.user.LoginUserVO
     **/
    LoginUserVO login(String userAccount, String userPassword, HttpServletRequest request);
    /**
     * @description: 获取当前登录用户
     * @author: gel
     * @param: [request]
     * @return: com.gel.codegeneration.model.entity.User
     **/
    User getLoginUser(HttpServletRequest request);
    /**
     * @description: 用户注销
     * @author: gel
     * @param: [request]
     * @return: java.lang.boolean
     **/

    boolean userLoginOut(HttpServletRequest request);
    //获取用户信息
    UserVO getUseVO(User user);
    //获取批量用户信息
    List<UserVO> getUserVOList(List<User> userList);

    //用户请求转换为query对象
    QueryWrapper getQuerywrapper(UserQueryRequest userQueryRequest);


    String getEncryptedPassword(String userPassword);
}
